<%--
  Created by IntelliJ IDEA.
  User: yutao
  Date: 2017/4/20
  Time: 14:19
  To change this template use File | Settings | File Templates.
--%>
<%@ page import="com.oriental.riskfront.api.enums.TransCode "%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ include file=".././common/taglibs.jsp" %>
<html>
<head>
    <title>Title</title>
    <script src="${ctx}/js/views/specially/batchMessage.js"></script>
</head>
<body ng-app="myApp" style="overflow:scroll;overflow-x:hidden">
<core:import url="../common/pageHead.jsp">
    <core:param name="title" value="查询特约商户上报审核"/>
</core:import>
<div ng-controller="queryCtrl" class="container-fluid">
    <form id="queryForm" name="queryForm" action="${ctx}/specially/batchMessage/search" class="form-inline" autocomplete="off">
        <table table-detail>
            <tr>
                <td class="text-right">
                    报送类型：
                </td>
                <td>
                    <select class="{{vm.constant.inputClass}}" ng-model="vm.queryBean.trnxCode"
                            ng-options="key as value for (key,value) in vm.cached.SPECIALLY_TRANS_CODE_AUDIT" ng-change="vm.resetValue()">
                        <option value="">请选择</option>
                    </select>
                </td>
                <td class="text-right">
                    报送日期：
                </td>
                <td>
                    <input type="text" class="{{vm.constant.inputClass}}" uib-datepicker-popup="yyyy-MM-dd"
                           ng-model="vm.queryBean.reportDate"/>
                </td>
                <td class="text-right">
                    消息状态：
                </td>
                <td>
                    <select class="{{vm.constant.inputClass}}" ng-model="vm.queryBean.status"
                            ng-options="key as value for (key,value) in vm.cached.SPECIALLY_AUDIT_STATUS">
                        <option value="">请选择</option>
                    </select>
                </td>
            </tr>
            <tbody  ng-if="'<%=TransCode.EER001.getCode()%>' == vm.queryBean.trnxCode || '<%=TransCode.EDEL01.getCode()%>' == vm.queryBean.trnxCode">
            <tr>
                <td class="text-right">
                    商户号:
                </td>
                <td>
                    <input type="text" ng-model="vm.queryBean.merchant" class="{{vm.constant.inputClass}}">
                </td>
            </tr>
            </tbody>
            <tbody  ng-if="'<%=TransCode.ER0001.getCode()%>' == vm.queryBean.trnxCode  || '<%=TransCode.UP0004.getCode()%>' == vm.queryBean.trnxCode || '<%=TransCode.UP0004_1.getCode()%>' == vm.queryBean.trnxCode || '<%=TransCode.UP0004_2.getCode()%>' == vm.queryBean.trnxCode">
            <tr>
                <td class="text-right">
                    商户号:
                </td>
                <td>
                    <input type="text" ng-model="vm.queryBean.merchant" class="{{vm.constant.inputClass}}">
                </td>
                <td class="text-right">
                    风险类型:
                </td>
                <td>
                    <select ng-model="vm.queryBean.riskType" class="{{vm.constant.inputClass}}"
                            ng-options="key as value for (key,value) in vm.cache.MERCHANT_RISK_TYPE">
                        <option value="">请选择</option>
                    </select>
                </td>
                <td class="text-right">
                    信息级别:
                </td>
                <td>
                    <select ng-model="vm.queryBean.level" class="{{vm.constant.inputClass}}"
                            ng-options="key as value for (key,value) in vm.cache.INFORMATION_LEVEL">
                        <option value="">请选择</option>
                    </select>
                </td>
            </tr>
            </tbody>
            <tbody ng-if="'<%=TransCode.PR0001.getCode()%>' == vm.queryBean.trnxCode || '<%=TransCode.UP0002.getCode()%>' == vm.queryBean.trnxCode || '<%=TransCode.UP0002_1.getCode()%>' == vm.queryBean.trnxCode">
            <tr>
                <td class="text-right">
                    风险类型:
                </td>
                <td>
                    <select ng-model="vm.queryBean.riskType" class="{{vm.constant.inputClass}}"
                            ng-options="key as value for (key,value) in vm.cache.PERSONAL_RISK_TYPE">
                        <option value="">请选择</option>
                    </select>
                </td>
                <td class="text-right">
                    信息级别:
                </td>
                <td>
                    <select ng-model="vm.queryBean.level" class="{{vm.constant.inputClass}}"
                            ng-options="key as value for (key,value) in vm.cache.INFORMATION_LEVEL">
                        <option value="">请选择</option>
                    </select>
                </td>
            </tr>
            </tbody>
            <tr>
                <td colspan="8" class="textCenter">
                    <button type="button" ng-click="vm.queryDetail()" class="btn btn-default">查询</button>
                    <button type="button" ng-click="vm.resetForm()" class="btn btn-default">重置</button>
                </td>
            </tr>
        </table>
    </form>

    <div>
    <shiro:hasPermission name="specially_audit">
        <div class="text-left">
            <button type="button" ng-click="vm.auditSucc('04')">审核通过</button>
            <button type="button" ng-click="vm.auditfail('05')">审核拒绝</button>
            <%--<button type="button" ng-click="vm.downloadCheckFile()">下载</button>--%>
        </div>
    </shiro:hasPermission>
        <table table-detail>
            <thead>
            <tr>
                <th></th>
                <th>报送类型</th>
                <th>商户号</th>
                <th>身份证号</th>
                <th>风险等级</th>
                <th>风险类型</th>
                <th>消息状态</th>
                <th>报送日期</th>
                <th>拒绝原因</th>
                <th>操作</th>
            </tr>
            </thead>
            <tbody ng-repeat="bean in vm.pagination.list track by $index">
            <td>
                <%--{{ bean.status}}--%>
                <input name="check" type="checkbox" ng-model="bean._checked"
                       ng-if="'00' == bean.status || (bean.status == '03' && (bean.trnxCode == 'EER001' ||bean.trnxCode == 'UP0002'
                       ||bean.trnxCode == 'UP0004' || bean.trnxCode == 'QR0001'|| bean.trnxCode == 'QR0002'))">
                <input name="check" type="checkbox" ng-model="bean._checked" disabled="disabled"
                       ng-if="'05' == bean.status || '06' == bean.status || '01' == bean.status
                       || '02' == bean.status">
            </td>

            <td>{{vm.cached.SPECIALLY_TRANS_CODE[bean.trnxCode]}}</td>
            <td>{{bean.merchant}}</td>
            <td>{{bean.docCode}}</td>
            <td>{{vm.cache.INFORMATION_LEVEL[bean.level]}}</td>
            <td ng-if="bean.trnxCode == 'ER0001' || bean.trnxCode == 'UP0004' || bean.trnxCode == 'UP0004_1' || bean.trnxCode == 'UP0004_2'">{{vm.cache.MERCHANT_RISK_TYPE[bean.riskType]}}</td>
            <td ng-if="bean.trnxCode == 'PR0001' || bean.trnxCode == 'UP0002'|| bean.trnxCode == 'UP0002_1'">{{vm.cache.PERSONAL_RISK_TYPE[bean.riskType]}}</td>
            <td ng-if="bean.trnxCode == 'EER001' || bean.trnxCode == 'EDEL01'"></td>
            <td>{{vm.cached.SPECIALLY_AUDIT_STATUS[bean.status]}}</td>
            <td>{{bean.reportDate| date:'yyyy-MM-dd'}}</td>
            <td ng-if="bean.status == '05'"><button type="button" ng-click="vm.toFailMsgDetail(bean)">查看拒绝原因</button></td>
            <td ng-if="bean.status != '05'"></td>
            <td><button type="button" ng-click="vm.queryBatchDetail(bean)">查看明细</button></td>
            </tbody>

            <tfoot>
            <tr>


            </tr>
            </tfoot>
        </table>
    </div>

    <core:import url="../common/pageFoot.jsp"/>
</div>
<core:import url="../common/nav.jsp"/>
</body>
</html>
